<?php
namespace app\api\model;

use \think\Db;
use \think\Image;
use \think\Session;

class Worker extends BaseModel
{
//$tid,$worker,$pwd,$name,$address,$phone,$idImgback,$idImgfront,$headPortrait,$companyPicback,$companyPicfront,
//$pid,$mv,$healthy,$insurance,$seniority,$introduce,$workTime,$certificate,$face,$putForward,$qualification,$organizationCode,
//$businessLicense,$reject,$state,$reputation,$idNumber
    public function Worker()
    {
        $data = input('post.');
        if($data['tid'] == 1)
        {
            $sql = Db::name('worker')
                ->insert([
                    'tid'=> $data['tid'],
                    'worker'=> $data['worker'],
                    'pwd'=> $data['pwd'],
                    'name'=> $data['name'],
                    'address'=> $data['address'],
                    'phone'=> $data['phone'],
                    'idImgback'=> $data['idImgback'],
                    'idImgfront'=> $data['idImgfront'],
                ]);
        }
        elseif ($data['tid'] == 2)
        {
            $sql = Db::name('worker')
                ->insert([

                ]);
        }else
        {
            $sql = Db::name('worker')
                ->insert([

                ]);
        }
        return $sql;
    }
}